package com.example.administrator.newproject;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.RatingBar;
import android.widget.Toast;


public class PingJiaDaFenActivity extends ActionBarActivity {

    private EditText pinfenneirong;
    private RatingBar bar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ping_jia_da_fen);

        bar = (RatingBar) findViewById(R.id.ratingBar);

        bar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
            @Override
            public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {

                ratingBar.setRating(rating);

            }
        });


        pinfenneirong = (EditText) findViewById(R.id.pingfenneirong);
         findViewById(R.id.pingfentijiao).setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 pinfenneirong.setText("");
                 bar.setRating(0);
                 Toast.makeText(PingJiaDaFenActivity.this,"提交成功",Toast.LENGTH_SHORT).show();


             }
         });

    }


}
